//
// UPlayList.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class UPlayList {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public UPlayList(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(UPlayList obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        throw new UnsupportedOperationException("C++ destructor does not have public access");
      }
      swigCPtr = 0;
    }
  }

  public void registerTransform(UTransform object, String prefix) {
    nel3dJNI.UPlayList_registerTransform__SWIG_0(swigCPtr, this, UTransform.getCPtr(object), object, prefix);
  }

  public void registerTransform(UTransform object) {
    nel3dJNI.UPlayList_registerTransform__SWIG_1(swigCPtr, this, UTransform.getCPtr(object), object);
  }

  public void resetAllChannels() {
    nel3dJNI.UPlayList_resetAllChannels(swigCPtr, this);
  }

  public void emptyPlayList() {
    nel3dJNI.UPlayList_emptyPlayList(swigCPtr, this);
  }

  public void setAnimation(short slot, long animation) {
    nel3dJNI.UPlayList_setAnimation(swigCPtr, this, slot, animation);
  }

  public long getAnimation(short slot) {
    return nel3dJNI.UPlayList_getAnimation(swigCPtr, this, slot);
  }

  public void setTimeOrigin(short slot, double timeOrigin) {
    nel3dJNI.UPlayList_setTimeOrigin(swigCPtr, this, slot, timeOrigin);
  }

  public double getTimeOrigin(short slot) {
    return nel3dJNI.UPlayList_getTimeOrigin(swigCPtr, this, slot);
  }

  public void setSpeedFactor(short slot, float speedFactor) {
    nel3dJNI.UPlayList_setSpeedFactor(swigCPtr, this, slot, speedFactor);
  }

  public float getSpeedFactor(short slot) {
    return nel3dJNI.UPlayList_getSpeedFactor(swigCPtr, this, slot);
  }

  public void setWrapMode(short slot, UPlayList.TWrapMode wrapMode) {
    nel3dJNI.UPlayList_setWrapMode(swigCPtr, this, slot, wrapMode.swigValue());
  }

  public UPlayList.TWrapMode getWrapMode(short slot) {
    return UPlayList.TWrapMode.swigToEnum(nel3dJNI.UPlayList_getWrapMode(swigCPtr, this, slot));
  }

  public void setStartWeight(short slot, float startWeight, double time) {
    nel3dJNI.UPlayList_setStartWeight(swigCPtr, this, slot, startWeight, time);
  }

  public float getStartWeight(short slot, SWIGTYPE_p_double time) {
    return nel3dJNI.UPlayList_getStartWeight(swigCPtr, this, slot, SWIGTYPE_p_double.getCPtr(time));
  }

  public void setEndWeight(short slot, float endWeight, double time) {
    nel3dJNI.UPlayList_setEndWeight(swigCPtr, this, slot, endWeight, time);
  }

  public float getEndWeight(short slot, SWIGTYPE_p_double time) {
    return nel3dJNI.UPlayList_getEndWeight(swigCPtr, this, slot, SWIGTYPE_p_double.getCPtr(time));
  }

  public void setWeightSmoothness(short slot, float smoothness) {
    nel3dJNI.UPlayList_setWeightSmoothness(swigCPtr, this, slot, smoothness);
  }

  public float getWeightSmoothness(short slot) {
    return nel3dJNI.UPlayList_getWeightSmoothness(swigCPtr, this, slot);
  }

  public void setWeight(short slot, float weight) {
    nel3dJNI.UPlayList_setWeight(swigCPtr, this, slot, weight);
  }

  public float getLocalTime(short slot, double globalTime, UAnimationSet animSet) {
    return nel3dJNI.UPlayList_getLocalTime(swigCPtr, this, slot, globalTime, UAnimationSet.getCPtr(animSet), animSet);
  }

  public float getLocalWeight(short slot, double globalTime) {
    return nel3dJNI.UPlayList_getLocalWeight(swigCPtr, this, slot, globalTime);
  }

  public void setSkeletonWeight(short slot, long skeletonId, boolean inverted) {
    nel3dJNI.UPlayList_setSkeletonWeight__SWIG_0(swigCPtr, this, slot, skeletonId, inverted);
  }

  public void setSkeletonWeight(short slot, long skeletonId) {
    nel3dJNI.UPlayList_setSkeletonWeight__SWIG_1(swigCPtr, this, slot, skeletonId);
  }

  public long getSkeletonWeight(short slot, SWIGTYPE_p_bool inverted) {
    return nel3dJNI.UPlayList_getSkeletonWeight(swigCPtr, this, slot, SWIGTYPE_p_bool.getCPtr(inverted));
  }

  public void enableChannel(long channelId, boolean enable) {
    nel3dJNI.UPlayList_enableChannel(swigCPtr, this, channelId, enable);
  }

  public boolean isChannelEnabled(long channelId) {
    return nel3dJNI.UPlayList_isChannelEnabled(swigCPtr, this, channelId);
  }

  public final static int empty = nel3dJNI.UPlayList_empty_get();

  public final static class TWrapMode {
    public final static TWrapMode Clamp = new TWrapMode("Clamp", nel3dJNI.UPlayList_Clamp_get());
    public final static TWrapMode Repeat = new TWrapMode("Repeat");
    public final static TWrapMode Disable = new TWrapMode("Disable");
    public final static TWrapMode WrapModeCount = new TWrapMode("WrapModeCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TWrapMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TWrapMode.class + " with value " + swigValue);
    }

    private TWrapMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TWrapMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TWrapMode(String swigName, TWrapMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TWrapMode[] swigValues = { Clamp, Repeat, Disable, WrapModeCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
